package com.heima.feign.schedule;


import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.schedule.dtos.TaskDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient("leadnews-schedule")
public interface IScheduleFeignClient {
    /**
     * 添加任务
     * @param dto 任务对象
     * @return  任务Id
     */
    @PostMapping("/api/vi/task/add")
    public ResponseResult addTask(@RequestBody TaskDto dto);

    /**
     * 拉取消费任务
     * @param type
     * @param priority
     * @return
     */
    @GetMapping("/api/vi/task/{type}/{priority}")
    public ResponseResult popTak(@PathVariable("type") Integer type ,@PathVariable("priority")  Integer priority);

}
